﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLKhachSan.DTO;
using System.Data;
using System.Data.SqlClient;

namespace QLKhachSan.DAO
{
    public class DAO_DichVu
    {
        public static void themDichVu(DTO_DichVu p)
        {
            string[] name = new string[5] { "@TenDV","@Mota","@DonViTinh","@DonGia","@MaLoaiDV" };
            object[] ob = new object[5] { p.TenDV,p.MoTa,p.DonViTinh,p.DonGia,p.MaLoaiDV };
            clsKetNoi.ThucThiLenhCoTS("pr_ThemDichVu", name, ob, 5);
        }
        public static DataTable hienthiDanhSachDichVu()
        {
            return clsKetNoi.Load("pr_HienThiDichVu");
        }
        public static void suaDichVu(DTO_DichVu p)
        {
            string[] name = new string[6] { "@MaDV","@TenDV", "@Mota", "@DonViTinh", "@DonGia" ,"@MaLoaiDV"};
            object[] ob = new object[6] { p.MaDV,p.TenDV, p.MoTa, p.DonViTinh, p.DonGia,p.MaLoaiDV };
            clsKetNoi.ThucThiLenhCoTS("pr_SuaDichVu", name, ob, 6);
        }
        public static void xoaDichVu(DTO_DichVu p)
        {
            string[] name = new string[1] { "@MaDV" };
            object[] ob = new object[1] { p.MaDV };
            clsKetNoi.ThucThiLenhCoTS("pr_XoaDichVu", name, ob, 1);
        }
    }
}
